﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Share/_LayoutBenlai.cshtml";
}

@{
    ViewBag.Title = "Document";
    Layout = "~/Views/Share/_LayoutBenlai.cshtml";
}
@section css{


}

@section scripts{
    <script src="~/Content/grid/src/noke.grid.edit.js"></script>
    
    <script>
        function $start() {

        }

        function AduitProductByStore(tag) {
            var model = {};
            model.SysNo = $('#txtSysNo').val();
            model.ProductID = $('#txtProductID').val();
            model.ProductName = $('#txtProductName').val();
            model.ProductBasicSysNo = $('#txtProductBasicSysNo').val();
            model.Weight = $('#txtWeight').val();
            model.Long = $('#txtLong').val();
            model.Width = $('#txtWidth').val();
            model.HIGH = $('#txtHIGH').val();
            model.Volume = $('#txtVolume').val();
            model.StorageMethods = $('#txtStorageMethods').val();
            model.DeliveryParttern = $('#txtDeliveryParttern').val();
            model.BarCode = $('#txtBarCode').val();
            model.IsAduiting = $('#txtIsAduiting').val();
            model.BitFlag = $('#txtBitFlag').val();
            model.Aduitor = 0;
            if (model.IsAduiting === 'false') {
                alert('不是待仓库审核状态。');
                return;
            }
            $(tag).hide();
            var url = '/ProductService/AduitProductByStore/';
            $.post(url, model, function (res) {
                $(tag).show();
                GetStoreAduitInfo(document.getElementById('btnGet'));
                alert(res.Value);
            }, 'json');

        }

        function GetStoreAduitInfo(tag) {
            var id = parseInt($('#txtProductSysNo').val());
            var url = '/ProductService/GetStoreAduitInfo/' + id;

            $(tag).hide();
            $.getJSON(url, function (res) {
                if (res.Code == 100) {
                    $(tag).show();
                    var model = res.Value;
                    $('#txtSysNo').val(model.SysNo);
                    $('#txtProductID').val(model.ProductID);
                    $('#txtProductName').val(model.ProductName);
                    $('#txtProductBasicSysNo').val(model.ProductBasicSysNo);
                    $('#txtWeight').val(model.Weight);
                    $('#txtLong').val(model.Long);
                    $('#txtWidth').val(model.Width);
                    $('#txtHIGH').val(model.HIGH);
                    $('#txtVolume').val(model.Volume);
                    $('#txtStorageMethods').val(model.StorageMethods);
                    $('#txtDeliveryParttern').val(model.DeliveryParttern);
                    $('#txtBarCode').val(model.BarCode);
                    $('#txtIsAduiting').val(model.IsAduiting);
                    $('#txtBitFlag').val(model.BitFlag);
                } else {
                    console.log(res.Msg);
                }
            }, 'json');
        }

        function BubbleEvent(e, tagName, callback) {
            e = e || window.event;
            var target = e.target || e.srcElement;
            if (target.nodeName.toString().toUpperCase() == tagName.toUpperCase()) {
                callback(target);
            }
        }

    </script>
   
}

<div class="row">
    
    <div class="col-lg-12">
        <h4 class="page-header">商品仓库审核接口测试</h4>
    </div>
    <!-- /.col-lg-12 -->
</div>
<!-- /.row -->

<div class="row">
    <div class="col-lg-3">
        <div class="panel input-group" id="btnSearch">
            <input id="txtProductSysNo" type="text" class="form-control" placeholder="商品编号">
            <div class="input-group-btn">
                <button class="btn btn-primary" type="button" onclick="GetStoreAduitInfo(this);"><i class="fa fa-search"></i> 获取仓库审核信息</button>
            </div>
        </div>
    </div>
</div>
<!-- /.row -->

<div class="row">
    <div class="col-lg-5">
        <div class="form-horizontal">
            <p>Sign in today for more expirience.</p>
            <div class="form-group"><label class="col-lg-2 control-label">商品编号</label>
                <div class="col-lg-10"><input type="text" placeholder="商品编号" class="form-control" id="txtSysNo" readonly></div>
            </div>
            <div class="form-group"><label class="col-lg-2 control-label">商品ID</label>
                <div class="col-lg-10"><input type="text" placeholder="商品ID" class="form-control" id="txtProductID" readonly></div>
            </div>
            <div class="form-group"><label class="col-lg-2 control-label">商品名称</label>
                <div class="col-lg-10"><input type="text" placeholder="商品名称" class="form-control" id="txtProductName" readonly></div>
            </div>
            <div class="form-group"><label class="col-lg-2 control-label">主商品编号</label>
                <div class="col-lg-10"><input type="text" placeholder="主商品编号" class="form-control" id="txtProductBasicSysNo" readonly></div>
            </div>
            
            <div class="form-group"><label class="col-lg-2 control-label">重量</label>
                <div class="col-lg-10"><input type="text" placeholder="重量" class="form-control" id="txtWeight"></div>
            </div>
            <div class="form-group"><label class="col-lg-2 control-label">长</label>
                <div class="col-lg-10"><input type="text" placeholder="长" class="form-control" id="txtLong"></div>
            </div>
            <div class="form-group"><label class="col-lg-2 control-label">宽</label>
                <div class="col-lg-10"><input type="text" placeholder="宽" class="form-control" id="txtWidth"></div>
            </div>
            <div class="form-group"><label class="col-lg-2 control-label">高</label>
                <div class="col-lg-10"><input type="text" placeholder="高" class="form-control" id="txtHIGH"></div>
            </div>
            <div class="form-group"><label class="col-lg-2 control-label">体积</label>
                <div class="col-lg-10"><input type="text" placeholder="体积" class="form-control" id="txtVolume"></div>
            </div>
            
            <div class="form-group"><label class="col-lg-2 control-label">条形码</label>
                <div class="col-lg-10"><input type="text" placeholder="条形码" class="form-control" id="txtBarCode"></div>
            </div>
   
            
            <div class="form-group"><label class="col-lg-2 control-label">存储方式</label>
                <div class="col-lg-10"><input type="text" placeholder="存储方式" class="form-control" id="txtStorageMethods"></div>
            </div>            
            <div class="form-group"><label class="col-lg-2 control-label">配送方式</label>
                <div class="col-lg-10"><input type="text" placeholder="配送方式" class="form-control" id="txtDeliveryParttern"></div>
            </div>
   
   
            
            <div class="form-group"><label class="col-lg-2 control-label">是否待审核</label>
                <div class="col-lg-10"><input type="text" placeholder="是否待审核" class="form-control" id="txtIsAduiting" readonly></div>
            </div>
            
            <div class="form-group"><label class="col-lg-2 control-label">位运算标识</label>
                <div class="col-lg-10"><input type="text" placeholder="位运算标识" class="form-control" id="txtBitFlag" readonly></div>
            </div>
   
            <div class="form-group">
                <div class="col-lg-offset-2 col-lg-10">
                    <button class="btn btn-sm btn-white btn-primary" type="submit" id="btnGet" onclick="AduitProductByStore(this);">审核</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- /.row -->

